import axios from "@/api";

// 登录
export const loginAPI = (data: any) => {
  return axios({
    url: "/service/user/login",
    method: "post",
    data
  });
};

//http://10.10.1.21:8080/service/user/modify/password

export const updatepsdAPI = (data: any) => {
  return axios({
    url: "/service/user/modify/password",
    method: "put",
    data
  });
};

// 获取用户信息
export const getUserInfoAPI = () => {
  return axios({
    url: "/mock/user/info",
    method: "get"
  });
};


export const getUserInfoListAPI = (data2: any, data: any) => {
  return axios({
    url: "/service/page/user?paged=" + data2.paged + "&&pageSize=" + data2.pageSize,
    method: "post",
    data
  });
};

export const addUserAPI = (data: any) => {
  return axios({
    url: "/service/user/info",
    method: "post",
    data
  });
};
export const setUserVideoUrl = (data: any) => {
  return axios({
    url: "/service/UserVideoUrl",
    method: "post",
    data
  });
};
export const getUserVideoUrl = (data2: any, data: any) => {
  return axios({
    url: "/service/userVideoUrl/page?paged=" + data2.paged + "&&pageSize=" + data2.pageSize,
    method: "post",
    data
  });
};

export const editUserAPI = (data: any) => {
  return axios({
    url: "/service/user/info",
    method: "put",
    data
  });
};
export const deleteUserAPI = (data: any) => {
  return axios({
    url: "/service/user/info?id=" + data,
    method: "delete",

  });
};

export const getMenuInfo = () => {
  return axios({
    url: "/service/menu/config",
    method: "get",
  });
};
export const submitMenu = (data: any) => {
  return axios({
    url: "/service/menu",
    method: "post",
    data
  });
};
export const updateMenu = (data: any) => {
  return axios({
    url: "/service/menu",
    method: "put",
    data
  });
};
export const deleteMenu = (id: any) => {
  return axios({
    url: "/service/menu/?id=" + id,
    method: "delete",
  });
};

